package business;

import java.util.ArrayList;
import java.util.Map;

import model.Subtopics;
import model.Topics;
import model.beans.TopicBean;

public class Temas {
	
	public static ArrayList list(int int_unitNumber, String str_academy, String str_subject){				
		ArrayList arrL_list = Topics.list(int_unitNumber, str_academy, str_subject);
		
		return arrL_list;
	}

	public static int edit(Map map_data){
		return Topics.edit(map_data);
	}
	
	public static TopicBean instance( int int_topicKey, String str_academy, String str_subject ){
		return Topics.instance(int_topicKey, str_academy, str_subject);
	}
	
	public static int add( Map map_data, int int_unitNumber){
		return Topics.add(map_data, int_unitNumber);
	}
	
	public static int delete( int int_topicKey, int int_unitNumber, String str_academy, String str_subject ){
		int int_retVal = 0;
		if( Subtopics.list(int_topicKey, int_unitNumber, str_academy, str_subject).size() == 0 ){
			int_retVal = Topics.delete(int_topicKey);
		}
		return int_retVal;
	}
}
